package top.wardyan.wdev.dbdevassist.model;

import top.wardyan.base.model.BaseMasterModel;
import top.wardyan.wdev.dbdevassist.po.Status;

@SuppressWarnings({ "unchecked", "serial" })
public abstract class MasterModel<T extends MasterModel<T>> extends BaseMasterModel<T>{

	/** 统一由存储过程指定 **/
	@Override
	public int primaryKeyType() {
		return 2;
	}

	/**
	public Integer getSStatus() {
		return this.getInt("sStatus");
	}
	**/
	public Status getSStatus() {
		return Status.getInstance(this.getInt("sStatus"));
	}
	
	public T setSStatus(int sStatus) {
		this.set("sStatus", sStatus);
		return (T)this;
	}
	
	// xName xType xDesc xNote
	// rAuthor_ID rOwner_ID rMender_ID rCheck_ID rAuditor_ID
	public String getXName() {
		return this.getStr("xName");
	}
	public T setXName(String xName) {
		this.set("xName", xName);
		return (T) this;
	}
	// xType
	public int getRTypeID() {
		return this.getInt("rType_ID");
	}
	public T setRTypeID(int rType_ID) {
		this.set("rType_ID", rType_ID);
		return (T) this;
	}
	public String getXDesc() {
		return this.getStr("xDesc");
	}
	public T setXDesc(String xDesc) {
		this.set("xDesc", xDesc);
		return (T)this;
	}
	public String getXHint() {
		return this.getStr("xHint");
	}
	public T setXHint(String xHint) {
		this.set("xHint", xHint);
		return (T)this;
	}
	public String getXNote() {
		return this.getStr("xNote");
	}
	public T setXNote(String xNote) {
		this.set("xNote", xNote);
		return (T)this;
	}
	
	public YTUser getRAuthorID() {
		return YTUser.getInstance(this.getInt("rAuthor_ID"), false);
	}
	public T setRAuthorID(int rAuthor_ID) {
		this.set("rAuthor_ID", rAuthor_ID);
		return (T) this;
	}
	
	public YTUser getROwnerID() {
		return YTUser.getInstance(this.getInt("rOwner_ID"), false);
	}
	public T setROwnerID(int rOwner_ID) {
		this.set("rOwner_ID", rOwner_ID);
		return (T) this;
	}
	
	public YTUser getRMenderID() {
		return YTUser.getInstance(this.getInt("rMender_ID"), false);
	}
	public T setRMenderID(int rMender_ID) {
		this.set("rMender_ID", rMender_ID);
		return (T) this;
	}
	
	public YTUser getRCheckerID() {
		return YTUser.getInstance(this.getInt("rChecker_ID"), false);
	}
	public T setRCheckerID(int rChecker_ID) {
		this.set("rChecker_ID", rChecker_ID);
		return (T) this;
	}
	
	public YTUser getRAuditorID() {
		return YTUser.getInstance(this.getInt("rAuditor_ID"), false);
	}
	public T setRAuditorID(int rAuditor_ID) {
		this.set("rAuditor_ID", rAuditor_ID);
		return (T) this;
	}
}
